package com.logicwin.RobotTravel.Screens;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.MediaController;
import android.widget.VideoView;

import com.logicwin.RobotTravel.R;

public class ScreenVideo extends Screen {
	public ScreenVideo() {
		super(SCREEN_TYPE.VIDEO_T, ScreenVideo.class.getCanonicalName());
	}	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
        setContentView(R.layout.screen_video);   

        final VideoView videoView = (VideoView) findViewById(R.id.VideoView01);  
  
        Button PauseButton = (Button) this.findViewById(R.id.PauseButton);   
        Button PlayButton = (Button) this.findViewById(R.id.PlayButton);  
  

        PlayButton.setOnClickListener(new OnClickListener() {  
            public void onClick(View arg0) { 

                videoView.setVideoPath("/sdcard/sample.mp4");  

                videoView.setMediaController(new MediaController(  
                		ScreenVideo.this));  
                videoView.requestFocus();             	

                videoView.start();  
            }  
        });  

        PauseButton.setOnClickListener(new OnClickListener() {  
            public void onClick(View arg0) {  

                videoView.pause();  
            }  
        });  
    }          
	
}
